﻿<?php
session_start();
require_once('check_login.php');
require_once('header.php');
require_once('contacts_lib.php');
$upcomming_birthdays=get_contacts_birthday_notif(7);
?>

<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php require_once('left_menu.php'); ?>
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			
			<!-- END STYLE CUSTOMIZER -->
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<ul class="page-breadcrumb breadcrumb">
						<li>
							<i class="fa fa-home"></i>
							<a href="index.php">
								Trang chủ
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
							<a href="#">
								Màn hình quản trị
							</a>
						</li>
						
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			
			<div class="clearfix">
			</div>
			<div class="row">
				
				<div class="col-md-6 col-sm-6">
					
					
				</div>
			</div>
			<div class="clearfix">
			</div>
			<div class="row ">
				<div class="col-md-12">
					<div class="">
					
						<div class="portlet-title">
							<div class="portlet box green">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-cogs"></i>Sinh nhật khách hàng trong 7 ngày tới
							</div>
							
						</div>
						<div class="portlet-body flip-scroll">
							<table id="upcomming_birthday_list" class="table table-bordered table-striped table-condensed flip-content">
							<thead class="flip-content">
							<tr>
							<th class="table-checkbox">
									<input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
								</th>
								<th>
									 Họ và Tên
								</th>
								<th>
									 Email
								</th>
								
								<th class="numeric">
									 Ngày sinh
								</th>
								<th class="numeric">
									 Tình trạng
								</th>
								
							</tr>
							</thead>
							<tbody>
							<?php foreach ($upcomming_birthdays as $upcomming_birthday){?>
							<tr>
								<td>
									<input type="checkbox" class="checkboxes" value="1"/>
								</td>
								<td>
									 <?php echo $upcomming_birthday['first_name']." ".$upcomming_birthday['last_name']  ?>
								</td>
								<td>
									 <?php echo $upcomming_birthday['email']?>
								</td>
								
								<td class="numeric">
									 <?php echo $upcomming_birthday['birth_day']?>
								</td>
								<td class="numeric">
									 
								</td>
								
							</tr>
							<?php }?>
							
							
							</tbody>
							</table>
							
						</div>
									
						
						
					</div>
						</div>
						
						<div class="table-toolbar">
								
								<div class="btn-group pull-right">
									<button id="send_all_birthday" class="btn green">
									Gửi toàn bộ <i class="fa fa-envelope"></i>
									</button>
								</div>
						</div>
						
					</div>
				</div>
				
			</div>
			<div class="clearfix">
			</div>
			
			<div class="clearfix">
			</div>
			
			<div class="clearfix">
			</div>
			
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

<?php 
require_once('footer.php');
require_once('common_script.php');
?>
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="assets/scripts/core/app.js" type="text/javascript"></script>
<script src="assets/scripts/custom/index.js" type="text/javascript"></script>
<script src="assets/scripts/custom/tasks.js" type="text/javascript"></script>
<script src="js/dashboard.js" type="text/javascript"></script>

<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() {    
   App.init(); // initlayout and core plugins
   Index.init();
   Index.initJQVMAP(); // init index page's custom scripts
   Index.initCalendar(); // init index page's custom scripts
   Index.initCharts(); // init index page's custom scripts
   Index.initChat();
   Index.initMiniCharts();
   Index.initDashboardDaterange();
   Index.initIntro();
   Tasks.initDashboardWidget();
   
   $('#send_all_birthday').live('click', function (e) {
                window.location='send_mail_birthday_alert.php';
            });
	TableManaged.init();
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>